<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
      body {
        background: deepskyblue;
      }
        .div1{
    width: 100px;
    height: 100px;
    margin-bottom: 10px;
    background: linear-gradient(to left, red, #f00) left top no-repeat,
    linear-gradient(to bottom, #f00, #f00) left top no-repeat,
    linear-gradient(to left, #f00, #f00) right top no-repeat,
    linear-gradient(to bottom, #f00, #f00) right top no-repeat,
    linear-gradient(to left, #f00, #f00) left bottom no-repeat,
    linear-gradient(to bottom, #f00, #f00) left bottom no-repeat,
    linear-gradient(to left, #f00, #f00) right bottom no-repeat,
    linear-gradient(to left, #f00, #f00) right bottom no-repeat;
    background-size: 1px 100%, 10px 1px, 1px 100%, 10px 1px;
  }
  .div-children {
    width: 100%;
    height: 100%;
    background: rgba(255,0, 255, .3);
  }
  .div2{
    width: 100px;
    height: 100px;
    background: linear-gradient(to bottom, #f00, blue) left top no-repeat,
    linear-gradient(to right, #f00, blue) left top no-repeat,
    linear-gradient(to bottom, #f00, blue) right top no-repeat,
    linear-gradient(to left, #f00, blue) right top no-repeat,
    linear-gradient(to top, #f00, blue) left bottom no-repeat,
    linear-gradient(to right, #f00, blue) left bottom no-repeat,
    linear-gradient(to top, #f00, blue) right bottom no-repeat,
    linear-gradient(to left, #f00, blue) right bottom no-repeat;
    background-size: 2px 20px, 20px 2px, 2px 20px, 20px 2px;
  }
    </style>
</head>
<body>
    <div class="div1">
      <div class="div-children"></div>
    </div>
    <div class="div2"></div>
</body>
</html>